GBML manual / Drawing

ANCHOR_BOTTOM_CENTER

Names the middle of the bottom edge of the screen, for draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored and draw_rect_fill_anchored - the position you give them is measured from this spot.

Syntax

ANCHOR_BOTTOM_CENTER: constant

Description

Names the middle of the bottom edge of the screen. Give it to draw_text_anchored, draw_text_warped_anchored, draw_text_3d_anchored, draw_rect_anchored or draw_rect_fill_anchored as their first argument, and the position you give after it is measured from this spot. The screen anchors page explains the idea in full.

Example

text_align(ALIGN_CENTER);
draw_text_anchored(ANCHOR_BOTTOM_CENTER, 0, -8, "PRESS START");

PRESS START, centered along the bottom, 8 pixels up so the whole line stays on screen. The offset is negative because a negative y moves up - back inside the screen from the bottom edge.

On the GBA

The screen is 240 pixels wide and 160 tall, and a plain draw call in a Draw GUI event counts from its top-left pixel, so this spot is the point (120, 160) in their numbers. ANCHOR_BOTTOM_CENTER with an offset of (x, y) lands on exactly the same pixel as the plain call in a Draw GUI event (x + 120, y + 160) - the same spot, written by what it means instead of by the size of the screen.

See also: Screen anchorsdraw_text_anchoreddraw_rect_fill_anchored